if ( copy_from_guest(&a, arg, 1) )
return -EFAULT;
- if ( current->domain->domain_id == a.domid )
- return -EPERM;
-
rc = rcu_lock_target_domain_by_id(a.domid, &d);
if ( rc != 0 )
return rc;
+ rc = -EPERM;
+ if ( d == current->domain )
+ goto param_fail5;
+
rc = -EINVAL;
if ( !is_hvm_domain(d) )
goto param_fail5;
if ( copy_from_guest(&a, arg, 1) )
return -EFAULT;
- if ( current->domain->domain_id == a.domid )
- return -EPERM;
-
rc = rcu_lock_target_domain_by_id(a.domid, &d);
if ( rc != 0 )
return rc;
+ rc = -EPERM;
+ if ( d == current->domain )
+ goto param_fail6;
+
rc = -EINVAL;
if ( !is_hvm_domain(d) )
goto param_fail6;
if ( copy_from_guest(&tr, arg, 1 ) )
return -EFAULT;
- if ( current->domain->domain_id == tr.domid )
- return -EPERM;
-
rc = rcu_lock_target_domain_by_id(tr.domid, &d);
if ( rc != 0 )
return rc;
+ rc = -EPERM;
+ if ( d == current->domain )
+ goto param_fail8;
+
rc = -EINVAL;
if ( !is_hvm_domain(d) )
goto param_fail8;
typedef struct xen_hvm_xentrace xen_hvm_xentrace_t;
DEFINE_XEN_GUEST_HANDLE(xen_hvm_xentrace_t);
+/* Following tools-only interfaces may change in future. */
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+
#define HVMOP_set_mem_access 12
typedef enum {
HVMMEM_access_n,
HVMMEM_access_rx,
HVMMEM_access_wx,
HVMMEM_access_rwx,
- HVMMEM_access_rx2rw, /* Page starts off as read-execute, but automatically change
- * to read-write on a write */
+ HVMMEM_access_rx2rw, /* Page starts off as r-x, but automatically
+ * change to r-w on a write */
HVMMEM_access_default /* Take the domain default */
} hvmmem_access_t;
/* Notify that a region of memory is to have specific access types */
typedef struct xen_hvm_inject_trap xen_hvm_inject_trap_t;
DEFINE_XEN_GUEST_HANDLE(xen_hvm_inject_trap_t);
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+
#endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */